home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
RMTP03.ARJ
/
WRITEDEF.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-02-25
|
1KB
|
50 lines
Program WriteDef;
Uses Graph;
Const
Hex : array[0..15] of char = ('0','1','2','3','4','5','6','7','8','9',
'A','B','C','D','E','F');
Var
Gd : Integer;
Gm : Integer;
F : Text;
I : Word;
J : Word;
Col : Word;
X1,X2 : Word;
Y1,Y2 : Word;
Begin
Gd:=EGA;
Gm:=EGAhi;
InitGraph(Gd,Gm,''); (* Set path where EGAVGA.BGI *)
(* is located *)
SetFillStyle(SolidFill,Blue);
Bar(0,0,639,349);
SetFillStyle(HatchFill,Green);
Bar(0,0,30,30);
SetFillStyle(SolidFill,LightRed);
Bar(20,20,40,40); (* Draw something *)
X1:=0;
Y1:=0;
X2:=40; (* Dimensions of image *)
Y2:=40;
Assign(F,'BOX2.DEF');
Rewrite(F);
For J:=Y1 to Y2 do
Begin
For I:=X1 to X2 do
begin
Col:=GetPixel(I,J);
Write(F,Hex[Col]);
End; (* Save image *)
Writeln(F);
End;
Close(F);
ReadLn; (* Wait for enter key *)
CloseGraph; (* Close graphics *)
End.